#ifndef ODBCPP_DIAGNOSTIC_RECORD_HPP
#define ODBCPP_DIAGNOSTIC_RECORD_HPP

#include "odbc/odbcpp_config.hpp"
#include "odbc/details/os_sql_wrapper.hpp"
#include <string>

namespace odbc { namespace details
{

/// \ingroup odbcpp
/// \brief It provides an information part regarding an ODBC specific error.
class diagnostic_record
{
public:
	///	\brief It initializes the diagnostic record with the description information.
	/// \param sqlState the five-character \c SQLSTATE code pertaining to the diagnostic record RecNumber. The first two
	///		characters indicate the class; the next three indicate the subclass.
	/// \param nativeError the native error code, specific to the data source.
	/// \param errorMessage the diagnostic message text string.
	/// \test The initialization of the diagnostic record.
	diagnostic_record( const std::string& sqlState, int nativeError, const std::string& errorMessage);

	/// \brief It gets the sql state of this diagnostic record.
	const std::string& sql_state() const
	{
		return sqlState_;
	}

	/// \brief It gets the error message of this diagnostic record.
	const std::string& error_message() const
	{
		return  errorMessage_;
	}

	///	\brief It gets the native error code of this diagnostic record.
	int native_error() const
	{
		return nativeError_;
	}

private:
	/// \internal
	///	\brief It contains the sql state.
	const std::string sqlState_;

	/// \internal
	/// \brief It contains the native error code.
	const int nativeError_;

	/// \internal
	/// \brief It contains the error message.
	const std::string errorMessage_;


private:
	diagnostic_record& operator=( const diagnostic_record& );
};

} } // namespace details // namespace odbc

#endif //ODBCPP_DIAGNOSTIC_RECORD_HPP
